package com.huidz.calendar.activity;

import android.os.Bundle;
import android.transition.Slide;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import com.huidz.calendar.R;
import com.huidz.calendar.activityadapter.HuangliAdapter;

import java.util.ArrayList;
import java.util.List;

public class HuangliActivity extends AppCompatActivity implements View.OnClickListener {

    private ListView home_list;
    private List<Fragment> fraglist;
    private ImageView comeback;
    private ArrayList<String> new_list_view;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Slide slide = new Slide(Gravity.RIGHT);
        slide.setDuration(200L);//间歇时间
        getWindow().setEnterTransition(slide);
        setContentView(R.layout.huangli_listhead);
        inti();
    }

    /**
     * 初始化加载调用方法
     */
    public void inti() {
        comeback = findViewById(R.id.title_comeback);
        comeback.setOnClickListener(this);
        home_list = findViewById(R.id.hl_list);
        new_list_view = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            new_list_view.add("" + i);
        }
        HuangliAdapter myAdapter = new HuangliAdapter(new_list_view,
                HuangliActivity.this);
        home_list.setAdapter(myAdapter);
    }



    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.title_comeback:
                onBackPressed();
                break;
        }
    }

    public static long firstTime = 0;


}
